public new static KGGaussian <T> FromMatlabStruct(MatlabStruct s) { // s = struct(); // s.className=class(this); // s.kegauss = this.kegauss.toStruct(); // s.embed_width2 = this.embed_width2; // s.width2 = this.width2; // string className = s.GetString("className"); if (!className.Equals(MATLAB_CLASS)) { throw new ArgumentException("The input does not represent a " + typeof(KGGaussian <T>)); } // KEGaussian<T> keGauss = KEGaussian<T>.FromMatlabStruct(s.GetStruct("kegauss")); double[] embedSquaredWidths = s.Get1DDoubleArray("embed_width2s"); if (!MatrixUtils.IsAllPositive(embedSquaredWidths)) { throw new ArgumentException("all embedding width^2's must be positive."); } double squaredWidth = s.GetDouble("width2"); if (squaredWidth <= 0) { throw new ArgumentException("width2 must be > 0"); } return(new KGGaussian <T>(embedSquaredWidths, squaredWidth)); }
public new static KEGaussian <T> FromMatlabStruct(MatlabStruct s) { string className = s.GetString("className"); if (!className.Equals(MATLAB_CLASS)) { throw new ArgumentException("The input does not represent a " + typeof(KEGaussian <T>)); } double[] gwidth2s = s.Get1DDoubleArray("gwidth2s"); if (!MatrixUtils.IsAllPositive(gwidth2s)) { throw new ArgumentException("all width^2's must be positive."); } return(new KEGaussian <T>(gwidth2s)); }