001 /* 002 * Copyright (C) 2008-2010 by Holger Arndt 003 * 004 * This file is part of the Universal Java Matrix Package (UJMP). 005 * See the NOTICE file distributed with this work for additional 006 * information regarding copyright ownership and licensing. 007 * 008 * UJMP is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU Lesser General Public License as 010 * published by the Free Software Foundation; either version 2 011 * of the License, or (at your option) any later version. 012 * 013 * UJMP is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU Lesser General Public License for more details. 017 * 018 * You should have received a copy of the GNU Lesser General Public 019 * License along with UJMP; if not, write to the 020 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 021 * Boston, MA 02110-1301 USA 022 */ 023 024 package org.ujmp.core.interfaces; 025 026 import java.math.BigDecimal; 027 import java.math.BigInteger; 028 import java.util.Date; 029 030 import org.ujmp.core.Matrix.StorageType; 031 import org.ujmp.core.enums.ValueType; 032 import org.ujmp.core.exceptions.MatrixException; 033 034 public interface BasicMatrixProperties { 035 036 public Iterable<Object> allValues(); 037 038 public ValueType getValueType(); 039 040 public long getValueCount(); 041 042 public boolean isReadOnly(); 043 044 public boolean isSingular(); 045 046 public boolean equals(Object o); 047 048 public boolean equalsContent(Object o); 049 050 public boolean equalsAnnotation(Object o); 051 052 public int rank() throws MatrixException; 053 054 public double trace() throws MatrixException; 055 056 public double det() throws MatrixException; 057 058 public boolean isDiagonal() throws MatrixException; 059 060 public boolean isSquare(); 061 062 public boolean isSymmetric(); 063 064 public boolean isSPD() throws MatrixException; 065 066 public boolean isEmpty() throws MatrixException; 067 068 public boolean isColumnVector(); 069 070 public boolean isRowVector(); 071 072 public boolean isScalar(); 073 074 public boolean isResizable(); 075 076 public boolean isMultidimensionalMatrix(); 077 078 public boolean isSparse(); 079 080 public boolean isTransient(); 081 082 public boolean containsMissingValues() throws MatrixException; 083 084 public double doubleValue() throws MatrixException; 085 086 public int intValue() throws MatrixException; 087 088 public long longValue() throws MatrixException; 089 090 public short shortValue() throws MatrixException; 091 092 public byte byteValue() throws MatrixException; 093 094 public boolean booleanValue() throws MatrixException; 095 096 public String stringValue() throws MatrixException; 097 098 public Date dateValue() throws MatrixException; 099 100 public char charValue() throws MatrixException; 101 102 public BigInteger bigIntegerValue() throws MatrixException; 103 104 public BigDecimal bigDecimalValue() throws MatrixException; 105 106 public float floatValue() throws MatrixException; 107 108 public double getMinValue() throws MatrixException; 109 110 public double getMeanValue() throws MatrixException; 111 112 public double getStdValue() throws MatrixException; 113 114 public double getMaxValue() throws MatrixException; 115 116 public double getEuklideanValue() throws MatrixException; 117 118 public double getValueSum() throws MatrixException; 119 120 public double getAbsoluteValueSum() throws MatrixException; 121 122 public double getAbsoluteValueMean() throws MatrixException; 123 124 public double getRMS() throws MatrixException; 125 126 public long getRowCount(); 127 128 public long getColumnCount(); 129 130 public long getZCount(); 131 132 public long getSize(int dimension); 133 134 public long[] getSize(); 135 136 /** 137 * Sets the size of the matrix. This is an optional method that is not 138 * implemented for all matrices. If this method is not implemented, a 139 * <code>MatrixException</code> is thrown. 140 * 141 * @param size 142 * the new size of the matrix 143 */ 144 public void setSize(long... size); 145 146 public int getDimensionCount(); 147 148 public String toString(); 149 150 public double norm1(); 151 152 public double norm2(); 153 154 public double normF(); 155 156 public double normInf(); 157 158 public StorageType getStorageType(); 159 160 public boolean containsNull(); 161 162 public boolean containsBigDecimal(BigDecimal v); 163 164 public boolean containsBigInteger(BigInteger v); 165 166 public boolean containsBoolean(boolean v); 167 168 public boolean containsByte(byte v); 169 170 public boolean containsChar(char v); 171 172 public boolean containsDate(Date v); 173 174 public boolean containsDouble(double v); 175 176 public boolean containsFloat(float v); 177 178 public boolean containsInt(int v); 179 180 public boolean containsLong(long v); 181 182 public boolean containsObject(Object o); 183 184 public boolean containsShort(short v); 185 186 public boolean containsString(String s); 187 188 }