Changeset 14244 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Matrix.cs
- Timestamp:
- 08/08/16 20:48:54 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Matrix.cs
r14234 r14244 1 using System; 2 using System.Runtime.InteropServices; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 3 21 4 namespace HeuristicLab.igraph.Wrappers { 5 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 6 public class Matrix : IDisposable { 22 using System; 23 24 namespace HeuristicLab.IGraph.Wrappers { 25 public sealed class Matrix : IDisposable { 7 26 igraph_matrix_t matrix; 8 27 internal igraph_matrix_t NativeInstance { get { return matrix; } } … … 11 30 12 31 public Matrix(int nrow, int ncol) { 32 if (nrow < 0 || ncol < 0) throw new ArgumentException("Rows and Columns must be >= 0"); 13 33 matrix = new igraph_matrix_t(); 14 34 DllImporter.igraph_matrix_init(matrix, nrow, ncol); 35 } 36 public Matrix(Matrix other) { 37 if (other == null) throw new ArgumentNullException("other"); 38 matrix = new igraph_matrix_t(); 39 DllImporter.igraph_matrix_copy(matrix, other.NativeInstance); 15 40 } 16 41 ~Matrix() {
Note: See TracChangeset
for help on using the changeset viewer.