-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcapiCivita.h
More file actions
23 lines (22 loc) · 786 Bytes
/
capiCivita.h
File metadata and controls
23 lines (22 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
Ravel C API. © Ravelation Pty Ltd 2023
*/
#ifndef CAPICIVITA_H
#define CAPICIVITA_H
#include <stdlib.h>
/// First argument of these method pointers is effectively the this pointer
struct CAPITensor
{
/// return a json representation of a hypercube
const char* (*hypercube)(const struct CAPITensor*);
/// return number of non-zero elements in the tensor
size_t (*size)(const struct CAPITensor*);
/// return number of elements in the index vector: 0 implies dense data
size_t (*indexSize)(const struct CAPITensor*);
/// return \a index[i]
size_t (*index)(const struct CAPITensor*, size_t i);
/// return element \a i. If sparse, this is equivalent to T[index[i]].
double (*at)(const struct CAPITensor*,size_t i);
};
typedef struct CAPITensor CAPITensor;
#endif