CovarianceIndexer.java

  1. /* Copyright 2002-2021 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.files.ccsds.ndm.odm.ocm;

  18. /** Container for covariance matrix elements indices.
  19.  * @author Luc Maisonobe
  20.  * @since 11.0
  21.  */
  22. class CovarianceIndexer {

  23.     /** Matrix dimension. */
  24.     private final int dimension;

  25.     /** Row index. */
  26.     private int row;

  27.     /** Column index. */
  28.     private int column;

  29.     /** Flag for cross-correlation trems. */
  30.     private boolean crossCorrelation;

  31.     /** Build an indexer pointing at first row first column,.
  32.      * @param dimension matrix dimension
  33.      */
  34.     CovarianceIndexer(final int dimension) {
  35.         this.dimension        = dimension;
  36.         this.row              = 0;
  37.         this.column           = 0;
  38.         this.crossCorrelation = false;
  39.     }

  40.     /** Get matrix dimension.
  41.      * @return matrix dimension
  42.      */
  43.     public int getDimension() {
  44.         return dimension;
  45.     }

  46.     /** Get row index.
  47.      * @return row index
  48.      */
  49.     public int getRow() {
  50.         return row;
  51.     }

  52.     /** Set row index.
  53.      * @param row row index
  54.      */
  55.     public void setRow(final int row) {
  56.         this.row = row;
  57.     }

  58.     /** Get column index.
  59.      * @return column index
  60.      */
  61.     public int getColumn() {
  62.         return column;
  63.     }

  64.     /** Set column index.
  65.      * @param column column index
  66.      */
  67.     public void setColumn(final int column) {
  68.         this.column = column;
  69.     }

  70.     /** Set cross-correlation flag.
  71.      * @param crossCorrelation if true, element is a cross-correlation term
  72.      */
  73.     public void setCrossCorrelation(final boolean crossCorrelation) {
  74.         this.crossCorrelation = crossCorrelation;
  75.     }

  76.     /** Check if element is a cross-correlation term.
  77.      * @return true if element is a cross-correlation term
  78.      */
  79.     public boolean isCrossCorrelation() {
  80.         return crossCorrelation;
  81.     }

  82. }