/// <returns>a Builder for proto serialization</returns> public virtual ConcatVectorProto.ConcatVector.Builder GetProtoBuilder() { ConcatVectorProto.ConcatVector.Builder m = ConcatVectorProto.ConcatVector.NewBuilder(); for (int i = 0; i < pointers.Length; i++) { ConcatVectorProto.ConcatVector.Component.Builder c = ConcatVectorProto.ConcatVector.Component.NewBuilder(); c.SetSparse(sparse[i]); // We want to keep the data array size 0 if the pointers for this component is null if (pointers[i] != null) { for (int j = 0; j < pointers[i].Length; j++) { c.AddData(pointers[i][j]); } } m.AddComponent(c); } return(m); }
/// <summary><code>repeated .edu.stanford.nlp.loglinear.model.proto.ConcatVector factorTable = 2;</code></summary> public ConcatVectorTableProto.ConcatVectorTable.Builder AddFactorTable(int index, ConcatVectorProto.ConcatVector.Builder builderForValue) { if (factorTableBuilder_ == null) { EnsureFactorTableIsMutable(); factorTable_.Add(index, ((ConcatVectorProto.ConcatVector)builderForValue.Build())); OnChanged(); } else { factorTableBuilder_.AddMessage(index, ((ConcatVectorProto.ConcatVector)builderForValue.Build())); } return(this); }