Vector3 computeNormal(MathNet.Numerics.LinearAlgebra.Generic.Vector <Complex> eigenVa, Matrix <float> eigenVe) { // Keep the smallest eigenvector as surface normal int smallestId = 0; float smallestValue = float.MaxValue; for (int j = 0; j < eigenVe.ColumnCount; j++) { float lambda = (float)eigenVa[j].Real; if (lambda < smallestValue) { smallestId = j; smallestValue = lambda; } } var normalVector = eigenVe.Column(smallestId); return(ToVector3(normalVector)); }
private static Vector3 ToVector3(MathNet.Numerics.LinearAlgebra.Generic.Vector <float> v) { return(new Vector3(v[0], v[1], v[2])); }
public void AddToTheta(MathNet.Numerics.LinearAlgebra.Generic.Vector <double> vect, double scalar) { network.AddToParam(vect, scalar); }
public void AddToParam(MathNet.Numerics.LinearAlgebra.Generic.Vector <double> vect, double scalar) { this.AddToWeights(vect.ToArray(), scalar); }