<commit_before>package org.apache.ignite.math.impls.vector;

import org.apache.ignite.math.Tracer;
import org.apache.ignite.math.Vector;
import org.apache.ignite.math.impls.MathTestConstants;
import org.apache.ignite.math.impls.matrix.DenseLocalOnHeapMatrix;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Tests for {@link MatrixVectorView}
 */
public class MatrixVectorViewTest {//extends ExternalizeTest<MatrixVectorView>{
    private static final String UNEXPECTED_VALUE = "Unexpected value.";
    private static final int SMALL_SIZE = 3;
    private DenseLocalOnHeapMatrix parent;

    /** */
    @Before
    public void setup(){
        parent = new DenseLocalOnHeapMatrix(SMALL_SIZE, SMALL_SIZE);
        fillMatrix(parent);
    }

    /** */
    @Test
    public void testDiaganal(){
        Vector vector = parent.viewDiagonal();

        for (int i = 0; i < SMALL_SIZE; i++)
            assertEquals(UNEXPECTED_VALUE, parent.get(i, i), vector.get(i), 0d);
    }

    /** */
    @Test
    public void testRow(){
        for (int i = 0; i < SMALL_SIZE; i++) {
            Vector viewRow = parent.viewRow(i);

            for (int j = 0; j < SMALL_SIZE; j++)
                assertEquals(UNEXPECTED_VALUE, parent.get(i, j), viewRow.get(j), 0d);
        }
    }

    /** */
    @Test
    public void testCols(){
        for (int i = 0; i < SMALL_SIZE; i++) {
            Vector viewRow = parent.viewColumn(i);

            for (int j = 0; j < SMALL_SIZE; j++)
                assertEquals(UNEXPECTED_VALUE, parent.get(j, i), viewRow.get(j), 0d);
        }
    }

    /** */
    private void fillMatrix(DenseLocalOnHeapMatrix parent) {
        for(int i = 0; i < parent.rowSize(); i++)
            for(int j = 0; j < parent.columnSize(); j++)
                parent.set(i, j, i*parent.rowSize() + j);
    }
}<commit_msg>IGN-6530 wip - minor cleanup // spelling, failure logging, code style -- verified with diffs overview, clean rebuild and execution of unit tests<commit_after>package org.apache.ignite.math.impls.vector;

import org.apache.ignite.math.Vector;
import org.apache.ignite.math.impls.matrix.DenseLocalOnHeapMatrix;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Tests for {@link MatrixVectorView}
 */
public class MatrixVectorViewTest {
    /** */ private static final String UNEXPECTED_VALUE = "Unexpected value";
    /** */ private static final int SMALL_SIZE = 3;
    /** */ private DenseLocalOnHeapMatrix parent;

    /** */
    @Before
    public void setup(){
        parent = new DenseLocalOnHeapMatrix(SMALL_SIZE, SMALL_SIZE);
        fillMatrix(parent);
    }

    /** */
    @Test
    public void testDiagonal(){
        Vector vector = parent.viewDiagonal();

        for (int i = 0; i < SMALL_SIZE; i++)
            assertEquals(UNEXPECTED_VALUE + " at row / col " + i, parent.get(i, i), vector.get(i), 0d);
    }

    /** */
    @Test
    public void testRow(){
        for (int i = 0; i < SMALL_SIZE; i++) {
            Vector viewRow = parent.viewRow(i);

            for (int j = 0; j < SMALL_SIZE; j++)
                assertEquals(UNEXPECTED_VALUE + " at row " + i + " col " + j, parent.get(i, j), viewRow.get(j), 0d);
        }
    }

    /** */
    @Test
    public void testCols(){
        for (int i = 0; i < SMALL_SIZE; i++) {
            Vector viewRow = parent.viewColumn(i);

            for (int j = 0; j < SMALL_SIZE; j++)
                assertEquals(UNEXPECTED_VALUE+ " at row " + i + " col " + j, parent.get(j, i), viewRow.get(j), 0d);
        }
    }

    /** */
    private void fillMatrix(DenseLocalOnHeapMatrix parent) {
        for(int i = 0; i < parent.rowSize(); i++)
            for(int j = 0; j < parent.columnSize(); j++)
                parent.set(i, j, i*parent.rowSize() + j);
    }
}
{'fraction_non_alphanumeric': 0.13900414937759337, 'fraction_numerical': 0.006742738589211619, 'mean_word_length': 2.3982378854625552, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1468592', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1219, 'n_words': 311}