<commit_before>package edu.mit.commensalejml.impl;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import static edu.mit.commensalejml.impl.MethodHandleUtils.lookup;
import java.lang.invoke.MethodHandle;
import java.util.List;
import org.ejml.ops.CommonOps;

/**
 *
 * @author <NAME> <<EMAIL>>
 * @since 7/9/2014
 */
public final class Multiply extends Expr {
	private boolean transposeLeft, transposeRight;
	public Multiply(Expr left, boolean transposeLeft, Expr right, boolean transposeRight) {
		super(left, right);
		this.transposeLeft = transposeLeft;
		this.transposeRight = transposeRight;
	}

	public static Multiply regular(Expr left, Expr right) {
		return new Multiply(left, false, right, false);
	}

	public static Multiply transposeLeft(Expr left, Expr right) {
		return new Multiply(left, true, right, false);
	}

	public static Multiply transposeRight(Expr left, Expr right) {
		return new Multiply(left, false, right, true);
	}

	public static Multiply transposeBoth(Expr left, Expr right) {
		return new Multiply(left, true, right, true);
	}

	@Override
	public int rows() {
		return transposeLeft ? deps().get(0).rows() : deps().get(0).cols();
	}

	@Override
	public int cols() {
		return transposeRight ? deps().get(1).cols() : deps().get(1).rows();
	}

	public boolean isTransposeLeft() {
		return transposeLeft;
	}
	public void setTransposeLeft(boolean transposeLeft) {
		this.transposeLeft = transposeLeft;
	}
	public void toggleTransposeLeft() {
		setTransposeLeft(!isTransposeLeft());
	}
	public boolean isTransposeRight() {
		return transposeRight;
	}<commit_msg>Fix multiply dimension inference (matrices are hard)<commit_after>package edu.mit.commensalejml.impl;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import static edu.mit.commensalejml.impl.MethodHandleUtils.lookup;
import java.lang.invoke.MethodHandle;
import java.util.List;
import org.ejml.ops.CommonOps;

/**
 *
 * @author <NAME> <<EMAIL>>
 * @since 7/9/2014
 */
public final class Multiply extends Expr {
	private boolean transposeLeft, transposeRight;
	public Multiply(Expr left, boolean transposeLeft, Expr right, boolean transposeRight) {
		super(left, right);
		this.transposeLeft = transposeLeft;
		this.transposeRight = transposeRight;
	}

	public static Multiply regular(Expr left, Expr right) {
		return new Multiply(left, false, right, false);
	}

	public static Multiply transposeLeft(Expr left, Expr right) {
		return new Multiply(left, true, right, false);
	}

	public static Multiply transposeRight(Expr left, Expr right) {
		return new Multiply(left, false, right, true);
	}

	public static Multiply transposeBoth(Expr left, Expr right) {
		return new Multiply(left, true, right, true);
	}

	@Override
	public int rows() {
		return transposeLeft ? deps().get(0).cols() : deps().get(0).rows();
	}

	@Override
	public int cols() {
		return transposeRight ? deps().get(1).rows() : deps().get(1).cols();
	}

	public boolean isTransposeLeft() {
		return transposeLeft;
	}
	public void setTransposeLeft(boolean transposeLeft) {
		this.transposeLeft = transposeLeft;
	}
	public void toggleTransposeLeft() {
		setTransposeLeft(!isTransposeLeft());
	}
	public boolean isTransposeRight() {
		return transposeRight;
	}
{'fraction_non_alphanumeric': 0.1161875945537065, 'fraction_numerical': 0.006051437216338881, 'mean_word_length': 5.043875685557587, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3303935', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1065, 'n_words': 272}