示例#1
0
 public Vector(Vector other)
 {
     if (other == null)
     {
         throw new ArgumentNullException("other");
     }
     vector = new igraph_vector_t();
     DllImporter.igraph_vector_copy(vector, other.NativeInstance);
 }
示例#2
0
 public Vector(int length)
 {
     if (length < 0)
     {
         throw new ArgumentException("Rows and Columns must be >= 0");
     }
     vector = new igraph_vector_t();
     DllImporter.igraph_vector_init(vector, length);
 }
示例#3
0
 public void Dispose()
 {
     if (vector == null)
     {
         return;
     }
     DllImporter.igraph_vector_destroy(vector);
     vector = null;
     GC.SuppressFinalize(this);
 }
示例#4
0
        public Vector(IEnumerable <double> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            var vec = data.ToArray();

            vector = new igraph_vector_t();
            DllImporter.igraph_vector_init_copy(vector, vec);
        }