]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/go/arrow/internal/flatbuf/SparseMatrixIndexCSR.go
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / go / arrow / internal / flatbuf / SparseMatrixIndexCSR.go
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16
17 // Code generated by the FlatBuffers compiler. DO NOT EDIT.
18
19 package flatbuf
20
21 import (
22 flatbuffers "github.com/google/flatbuffers/go"
23 )
24
25 /// Compressed Sparse Row format, that is matrix-specific.
26 type SparseMatrixIndexCSR struct {
27 _tab flatbuffers.Table
28 }
29
30 func GetRootAsSparseMatrixIndexCSR(buf []byte, offset flatbuffers.UOffsetT) *SparseMatrixIndexCSR {
31 n := flatbuffers.GetUOffsetT(buf[offset:])
32 x := &SparseMatrixIndexCSR{}
33 x.Init(buf, n+offset)
34 return x
35 }
36
37 func (rcv *SparseMatrixIndexCSR) Init(buf []byte, i flatbuffers.UOffsetT) {
38 rcv._tab.Bytes = buf
39 rcv._tab.Pos = i
40 }
41
42 func (rcv *SparseMatrixIndexCSR) Table() flatbuffers.Table {
43 return rcv._tab
44 }
45
46 /// The type of values in indptrBuffer
47 func (rcv *SparseMatrixIndexCSR) IndptrType(obj *Int) *Int {
48 o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
49 if o != 0 {
50 x := rcv._tab.Indirect(o + rcv._tab.Pos)
51 if obj == nil {
52 obj = new(Int)
53 }
54 obj.Init(rcv._tab.Bytes, x)
55 return obj
56 }
57 return nil
58 }
59
60 /// The type of values in indptrBuffer
61 /// indptrBuffer stores the location and size of indptr array that
62 /// represents the range of the rows.
63 /// The i-th row spans from indptr[i] to indptr[i+1] in the data.
64 /// The length of this array is 1 + (the number of rows), and the type
65 /// of index value is long.
66 ///
67 /// For example, let X be the following 6x4 matrix:
68 ///
69 /// X := [[0, 1, 2, 0],
70 /// [0, 0, 3, 0],
71 /// [0, 4, 0, 5],
72 /// [0, 0, 0, 0],
73 /// [6, 0, 7, 8],
74 /// [0, 9, 0, 0]].
75 ///
76 /// The array of non-zero values in X is:
77 ///
78 /// values(X) = [1, 2, 3, 4, 5, 6, 7, 8, 9].
79 ///
80 /// And the indptr of X is:
81 ///
82 /// indptr(X) = [0, 2, 3, 5, 5, 8, 10].
83 func (rcv *SparseMatrixIndexCSR) IndptrBuffer(obj *Buffer) *Buffer {
84 o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
85 if o != 0 {
86 x := o + rcv._tab.Pos
87 if obj == nil {
88 obj = new(Buffer)
89 }
90 obj.Init(rcv._tab.Bytes, x)
91 return obj
92 }
93 return nil
94 }
95
96 /// indptrBuffer stores the location and size of indptr array that
97 /// represents the range of the rows.
98 /// The i-th row spans from indptr[i] to indptr[i+1] in the data.
99 /// The length of this array is 1 + (the number of rows), and the type
100 /// of index value is long.
101 ///
102 /// For example, let X be the following 6x4 matrix:
103 ///
104 /// X := [[0, 1, 2, 0],
105 /// [0, 0, 3, 0],
106 /// [0, 4, 0, 5],
107 /// [0, 0, 0, 0],
108 /// [6, 0, 7, 8],
109 /// [0, 9, 0, 0]].
110 ///
111 /// The array of non-zero values in X is:
112 ///
113 /// values(X) = [1, 2, 3, 4, 5, 6, 7, 8, 9].
114 ///
115 /// And the indptr of X is:
116 ///
117 /// indptr(X) = [0, 2, 3, 5, 5, 8, 10].
118 /// The type of values in indicesBuffer
119 func (rcv *SparseMatrixIndexCSR) IndicesType(obj *Int) *Int {
120 o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
121 if o != 0 {
122 x := rcv._tab.Indirect(o + rcv._tab.Pos)
123 if obj == nil {
124 obj = new(Int)
125 }
126 obj.Init(rcv._tab.Bytes, x)
127 return obj
128 }
129 return nil
130 }
131
132 /// The type of values in indicesBuffer
133 /// indicesBuffer stores the location and size of the array that
134 /// contains the column indices of the corresponding non-zero values.
135 /// The type of index value is long.
136 ///
137 /// For example, the indices of the above X is:
138 ///
139 /// indices(X) = [1, 2, 2, 1, 3, 0, 2, 3, 1].
140 ///
141 /// Note that the indices are sorted in lexicographical order for each row.
142 func (rcv *SparseMatrixIndexCSR) IndicesBuffer(obj *Buffer) *Buffer {
143 o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
144 if o != 0 {
145 x := o + rcv._tab.Pos
146 if obj == nil {
147 obj = new(Buffer)
148 }
149 obj.Init(rcv._tab.Bytes, x)
150 return obj
151 }
152 return nil
153 }
154
155 /// indicesBuffer stores the location and size of the array that
156 /// contains the column indices of the corresponding non-zero values.
157 /// The type of index value is long.
158 ///
159 /// For example, the indices of the above X is:
160 ///
161 /// indices(X) = [1, 2, 2, 1, 3, 0, 2, 3, 1].
162 ///
163 /// Note that the indices are sorted in lexicographical order for each row.
164 func SparseMatrixIndexCSRStart(builder *flatbuffers.Builder) {
165 builder.StartObject(4)
166 }
167 func SparseMatrixIndexCSRAddIndptrType(builder *flatbuffers.Builder, indptrType flatbuffers.UOffsetT) {
168 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(indptrType), 0)
169 }
170 func SparseMatrixIndexCSRAddIndptrBuffer(builder *flatbuffers.Builder, indptrBuffer flatbuffers.UOffsetT) {
171 builder.PrependStructSlot(1, flatbuffers.UOffsetT(indptrBuffer), 0)
172 }
173 func SparseMatrixIndexCSRAddIndicesType(builder *flatbuffers.Builder, indicesType flatbuffers.UOffsetT) {
174 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(indicesType), 0)
175 }
176 func SparseMatrixIndexCSRAddIndicesBuffer(builder *flatbuffers.Builder, indicesBuffer flatbuffers.UOffsetT) {
177 builder.PrependStructSlot(3, flatbuffers.UOffsetT(indicesBuffer), 0)
178 }
179 func SparseMatrixIndexCSREnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
180 return builder.EndObject()
181 }