Skip to content
Snippets Groups Projects

Tanguy

Open tanguy.dietrich requested to merge david.carballo/poo2019numeric:Tanguy into master
3 files
+ 28
11
Compare changes
  • Side-by-side
  • Inline

Files

@@ -124,7 +124,13 @@ final public class Vector {
}
public static Vector of(List<Double> elements) {
throw new UnsupportedOperationException("This feature isn't implemented yet");
//throw new UnsupportedOperationException("This feature isn't implemented yet");
Vector v = new Vector();
for(double e:elements)
{
v.lstVector.add(e);
}
return v;
}
public static Vector empty() {
@@ -138,7 +144,13 @@ final public class Vector {
}
public static Vector zeros(int nb) {
throw new UnsupportedOperationException("This feature isn't implemented yet");
Vector v = new Vector();
for(int i=0;i<nb;i++)
{
v.lstVector.add(0.0);
}
return v;
//throw new UnsupportedOperationException("This feature isn't implemented yet");
}
public static Vector ones(int nb) {
@@ -183,7 +195,6 @@ final public class Vector {
/*
@Override
public boolean equals(Object obj) {
if(this instanceof ch.hepia.numeric.Vector)
{
for(int i=0;i<this.lstVector.size();i++)//a ameliorer avec for(e:element)
Loading