NetworkData.Vector GetVectorData(MPSVector vector) { var v = new NetworkData.Vector(); v.Values.AddRange(vector.ToArray()); return(v); }
bool SetVectorData(MPSVector vector, NetworkData.Vector data) { if (data == null) { return(false); } var vs = data.Values; var n = (int)vector.Length; if (n != vs.Count) { return(false); } unsafe { var p = (float *)vector.Data.Contents; for (var i = 0; i < n; i++) { *p++ = vs[i]; } } return(true); }