コード例 #1
0
        private bool IsEqual(SparseVectorD other)
        {
            if (Length != other.Length)
            {
                return(false);
            }

            return(ArrayHelpers.ArraysEqual(_values, other._values) &&
                   ArrayHelpers.ArraysEqual(_indices, other._indices));
        }
コード例 #2
0
 public static VectorXD ToDense(this SparseVectorD sparseVectorD)
 {
     return(new VectorXD(Enumerable.Range(0, sparseVectorD.Length).Select(i => sparseVectorD.Get(i)).ToArray()));
 }