@@ -47,18 +47,34 @@ public final class MatrixFunctionBuilder {
4747 * Create the function builder, i.e., an object that can help you
4848 * represent a mathematical function as 2D matrix.
4949 *
50+ * @param expectedSize
51+ * the expected size of the resulting matrix
5052 * @param onlyOnePointPerYCoordinate
5153 * print only one point per {@code y} coordinate and omit all
5254 * following points with the same {@code y} value (except the
5355 * very last point added to the function)
5456 */
55- public MatrixFunctionBuilder (final boolean onlyOnePointPerYCoordinate ) {
57+ public MatrixFunctionBuilder (final int expectedSize ,
58+ final boolean onlyOnePointPerYCoordinate ) {
5659 super ();
57- this .m_builder = new MatrixBuilder ();
60+ this .m_builder = new MatrixBuilder (expectedSize * 2 );
5861 this .m_builder .setN (2 );
5962 this .m_onlyOnePointPerYCoordinate = onlyOnePointPerYCoordinate ;
6063 }
6164
65+ /**
66+ * Create the function builder, i.e., an object that can help you
67+ * represent a mathematical function as 2D matrix.
68+ *
69+ * @param onlyOnePointPerYCoordinate
70+ * print only one point per {@code y} coordinate and omit all
71+ * following points with the same {@code y} value (except the
72+ * very last point added to the function)
73+ */
74+ public MatrixFunctionBuilder (final boolean onlyOnePointPerYCoordinate ) {
75+ this (-1 , onlyOnePointPerYCoordinate );
76+ }
77+
6278 /**
6379 * Add two long integer coordinates
6480 *
0 commit comments