Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/08/16 20:48:54 (8 years ago)
Author:
abeham
Message:

#2651: worked on igraph integration, additional layout algorithms, density, page rank

  • added unit tests
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
    321
    4 namespace HeuristicLab.igraph.Wrappers {
    5   [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    6   public class Matrix : IDisposable {
     22using System;
     23
     24namespace HeuristicLab.IGraph.Wrappers {
     25  public sealed class Matrix : IDisposable {
    726    igraph_matrix_t matrix;
    827    internal igraph_matrix_t NativeInstance { get { return matrix; } }
     
    1130
    1231    public Matrix(int nrow, int ncol) {
     32      if (nrow < 0 || ncol < 0) throw new ArgumentException("Rows and Columns must be >= 0");
    1333      matrix = new igraph_matrix_t();
    1434      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);
    1540    }
    1641    ~Matrix() {
Note: See TracChangeset for help on using the changeset viewer.