-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMatrix.cs
More file actions
47 lines (34 loc) · 978 Bytes
/
Matrix.cs
File metadata and controls
47 lines (34 loc) · 978 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Diagnostics;
using System.IO;
namespace FastText
{
public abstract class Matrix
{
protected long m_;
protected long n_;
public Matrix() : this(0, 0)
{
}
public Matrix(long m, long n)
{
m_ = m;
n_ = n;
}
public long Size(long dim)
{
Debug.Assert(dim == 0 || dim == 1);
if (dim == 0)
{
return m_;
}
return n_;
}
public abstract float DotRow(float[] vec, long i);
public abstract void AddVectorToRow(float[] vec, long i, float a);
public abstract void AddRowToVector(float[] x, int i);
public abstract void AddRowToVector(float[] x, int i, float a);
public abstract void Save(BinaryWriter writer);
public abstract void Load(BinaryReader reader);
public abstract void Dump(TextWriter writer);
}
}