4
Copyright (C) 2006 Gabor Csardi <csardi@rmki.kfki.hu>
5
MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
7
This program 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 2 of the License, or
10
(at your option) any later version.
12
This program 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.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
int FUNCTION(igraph_array3,init)(TYPE(igraph_array3) *a, long int n1, long int n2,
29
ret=FUNCTION(igraph_vector,init)(&a->data, n1*n2*n3);
38
void FUNCTION(igraph_array3,destroy)(TYPE(igraph_array3) *a) {
39
FUNCTION(igraph_vector,destroy)(&a->data);
42
long int FUNCTION(igraph_array3,size)(const TYPE(igraph_array3) *a) {
43
return (a->n1n2) * (a->n3);
46
long int FUNCTION(igraph_array3,n)(const TYPE(igraph_array3) *a, long int idx) {
58
int FUNCTION(igraph_array3,resize)(TYPE(igraph_array3) *a, long int n1, long int n2,
60
int ret=FUNCTION(igraph_vector,resize)(&a->data, n1*n2*n3);
69
void FUNCTION(igraph_array3,null)(TYPE(igraph_array3) *a) {
70
FUNCTION(igraph_vector,null)(&a->data);
73
BASE FUNCTION(igraph_array3,sum)(const TYPE(igraph_array3) *a) {
74
return FUNCTION(igraph_vector,sum)(&a->data);
77
void FUNCTION(igraph_array3,scale)(TYPE(igraph_array3) *a, BASE by) {
78
FUNCTION(igraph_vector,scale)(&a->data, by);
81
void FUNCTION(igraph_array3,fill)(TYPE(igraph_array3) *a, BASE e) {
82
FUNCTION(igraph_vector,fill)(&a->data, e);
85
int FUNCTION(igraph_array3,update)(TYPE(igraph_array3) *to,
86
const TYPE(igraph_array3) *from) {
87
IGRAPH_CHECK(FUNCTION(igraph_array3,resize)(to, from->n1, from->n2, from->n3));
88
FUNCTION(igraph_vector,update)(&to->data, &from->data);