# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.integration.univariate.riemann.newtoncotes

## Enum NewtonCotes.Type

• All Implemented Interfaces:
Serializable, Comparable<NewtonCotes.Type>
Enclosing class:
NewtonCotes

public static enum NewtonCotes.Type
extends Enum<NewtonCotes.Type>
There are two types of the Newton-Cotes method: OPEN and CLOSED.
• ### Enum Constant Summary

Enum Constants
Enum Constant and Description
CLOSED
The first and the last terms in the Euler-Maclaurin formula are included in the sum.
OPEN
The first and the last terms in the Euler-Maclaurin formula are not included in the sum.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static NewtonCotes.Type valueOf(String name)
Returns the enum constant of this type with the specified name.
static NewtonCotes.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared.
• ### Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
• ### Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait
• ### Enum Constant Detail

• #### CLOSED

public static final NewtonCotes.Type CLOSED
The first and the last terms in the Euler-Maclaurin formula are included in the sum. They are: 1/2 * f(x0), and 1/2 * f(xn).
• #### OPEN

public static final NewtonCotes.Type OPEN
The first and the last terms in the Euler-Maclaurin formula are not included in the sum. This is to avoid computing for end points where f(x) cannot be evaluated. Instead, we use the mid-point to make the first rough estimate of the integral.
• ### Method Detail

• #### values

public static NewtonCotes.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (NewtonCotes.Type c : NewtonCotes.Type.values())
System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared
• #### valueOf

public static NewtonCotes.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null