File: AbstractMatrix.hpp

package info (click to toggle)
consensuscore 1.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,384 kB
  • sloc: cpp: 38,940; python: 2,083; ansic: 542; sh: 184; makefile: 82; cs: 10
file content (30 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Author: Lance Hepler

#pragma once

namespace ConsensusCore {

class AbstractMatrix
{
protected:
    AbstractMatrix() {}
    virtual ~AbstractMatrix() {}

public:  // Size information
    virtual int Rows() const = 0;
    virtual int Columns() const = 0;

public:  // Information about entries filled by column
    virtual int UsedEntries() const = 0;
    virtual int AllocatedEntries() const = 0;

public:  // Accessors
    virtual bool IsAllocated(int i, int j) const = 0;
    virtual float Get(int i, int j) const = 0;

public:
    // Method SWIG clients can use to get a native matrix (e.g. Numpy)
    // mat must be filled as a ROW major matrix
    virtual void ToHostMatrix(float** mat, int* rows, int* cols) const = 0;
};
}