コード例 #1
0
ファイル: Vector.cs プロジェクト: lulzzz/HeuristicLab
 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
ファイル: Vector.cs プロジェクト: lulzzz/HeuristicLab
 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
ファイル: Vector.cs プロジェクト: lulzzz/HeuristicLab
 public void Dispose()
 {
     if (vector == null)
     {
         return;
     }
     DllImporter.igraph_vector_destroy(vector);
     vector = null;
     GC.SuppressFinalize(this);
 }
コード例 #4
0
ファイル: Vector.cs プロジェクト: lulzzz/HeuristicLab
        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);
        }