ATLAS.java

package org.mklab.sdpj.gpack.atlas;

import org.mklab.nfc.matrix.ComplexNumericalMatrix;
import org.mklab.nfc.matrix.RealNumericalMatrix;
import org.mklab.nfc.scalar.ComplexNumericalScalar;
import org.mklab.nfc.scalar.RealNumericalScalar;


/**
 * @author koga
 * @version $Revision$, 2009/04/24
 */
public class ATLAS {

  /**
   * 引数の名前などはrsdpa_struct.cppと同じにしています。 型は変えてます。
   * 
 * @param <RS> type of real scalar
 * @param <RM> type of real matrix
 * @param <CS> type of complex scalar
 * @param <CM> type of complex Matrix
   * @param size size
   * @param value value
   * @param destination destination
   * @param step step
   */
  public static <RS extends RealNumericalScalar<RS, RM, CS, CM>, RM extends RealNumericalMatrix<RS, RM, CS, CM>, CS extends ComplexNumericalScalar<RS, RM, CS, CM>, CM extends ComplexNumericalMatrix<RS, RM, CS, CM>> void setValue(int size, RS value, RS[] destination, int step) {
    int index = 0;

    for (int i = 0; i < size; ++i) {
      destination[index] = value;
      index += step;
    }
  }
}