-
Notifications
You must be signed in to change notification settings - Fork 143
/
common.h
71 lines (60 loc) · 1.38 KB
/
common.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/////////////////////////////////////////////////////////////////////
// = NMatrix
//
// A linear algebra library for scientific computation in Ruby.
// NMatrix is part of SciRuby.
//
// NMatrix was originally inspired by and derived from NArray, by
// Masahiro Tanaka: http://narray.rubyforge.org
//
// == Copyright Information
//
// SciRuby is Copyright (c) 2010 - 2012, Ruby Science Foundation
// NMatrix is Copyright (c) 2012, Ruby Science Foundation
//
// Please see LICENSE.txt for additional copyright notices.
//
// == Contributing
//
// By contributing source code to SciRuby, you agree to be bound by
// our Contributor Agreement:
//
// * https://github.com/SciRuby/sciruby/wiki/Contributor-Agreement
//
// == common.h
//
// Header file for code common to all storage types.
#ifndef STORAGE_COMMON_H
#define STORAGE_COMMON_H
/*
* Standard Includes
*/
/*
* Project Includes
*/
#include "data/data.h"
#include "nmatrix.h"
/*
* Macros
*/
/*
* Types
*/
// For binary operations involving matrices that need to be casted.
struct STORAGE_PAIR {
STORAGE* left;
STORAGE* right;
};
struct SLICE {
size_t* coords; // Coordinate of first element
size_t* lengths; // Lengths of slice
bool single; // true if all lengths equal to 1 (represents single matrix element)
};
/*
* Data
*/
/*
* Functions
*/
size_t storage_count_max_elements(const STORAGE* storage);
#endif // STORAGE_COMMON_H