You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ttt.m
    path of file: ./repos/tensor_toolbox/@sptensor
    
    the code of the file until where you have to start completion: function c = ttt(varargin)
%TTT Sparse tensor times sparse tensor.
% 
%   Z = TTT(X,Y) computes the outer product of tensors X and Y.
%
%   Z = TTT(X,Y,XDIMS,YDIMS) computes the contracted product of
%   tensors X and Y in the dimensions specified by the row vectors
%   XDIMS and YDIMS.  The sizes of the dimensions specified by XDIMS
%   and YDIMS must match; that is, size(X,XDIMS) must equal
%   size(Y,YDIMS).
%
%   Z = TTT(X,Y,DIMS) computes the inner product of tensors X and Y in
%   the dimensions specified by the vector DIMS.  The sizes of the
%   dimensions specified by DIMS must match; that is, size(X,DIMS)
%   must equal size(Y,DIMS).
%
%   In all cases, the result Z is a sparse tensor if it has 50% or
%   fewer nonzeros; otherwise ther result is returned as a dense
%   tensor.
%
%   Examples
%   X = sptenrand([4 2 3], 10);
%   Y = sptenrand([3 4 2], 10);
%   Z = ttt(X,Y) %<-- outer product of X and Y
%   Z = ttt(X,X,1:3) %<-- inner product of X with itself
%   Z = ttt(X,Y,[1 2 3],[2 3 1]) %<-- inner product of X & Y

    
function c = ttt(varargin)
%TTT Sparse tensor times sparse tensor.
% 
%   Z = TTT(X,Y) computes the outer product of tensors X and Y.
%
%   Z = TTT(X,Y,XDIMS,YDIMS) computes the contracted product of
%   tensors X and Y in the dimensions specified by the row vectors
%   XDIMS and YDIMS.  The sizes of the dimensions specified by XDIMS
%   and YDIMS must match; that is, size(X,XDIMS) must equal
%   size(Y,YDIMS).
%
%   Z = TTT(X,Y,DIMS) computes the inner product of tensors X and Y in
%   the dimensions specified by the vector DIMS.  The sizes of the
%   dimensions specified by DIMS must match; that is, size(X,DIMS)
%   must equal size(Y,DIMS).
%
%   In all cases, the result Z is a sparse tensor if it has 50% or
%   fewer nonzeros; otherwise ther result is returned as a dense
%   tensor.
%
%   Examples
%   X = sptenrand([4 2 3], 10);
%   Y = sptenrand([3 4 2], 10);
%   Z = ttt(X,Y) %<-- outer product of X and Y
%   Z = ttt(X,X,1:3) %<-- inner product of X with itself
%   Z = ttt(X,Y,[1 2 3],[2 3 1]) %<-- inner product of X & Y
%   Z = ttt(X,Y,[1 3],[2 1]) %<-- product of X & Y along specified dims
%
%   See also SPTENSOR, TENSOR/TTT, SPTENSOR/TTV, SPTENSOR/TTM.
%
%MATLAB Tensor Toolbox.
%Copyright 2015, Sandia Corporation.

% This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others.
% http://www.sandia.gov/~tgkolda/TensorToolbox.
% Copyright (2015) Sandia Corporation. Under the terms of Contract
% DE-AC04-94AL85000, there is a non-exclusive license for use of this
% work by or on behalf of the U.S. Government. Export of this data may
% require a license from the United States Government.
% The full license terms can be found in the file LICENSE.txt



%%%%%%%%%%%%%%%%%%%%%%
%%% ERROR CHECKING %%%
%%%%%%%%%%%%%%%%%%%%%%

% Check the number of arguments
if (nargin < 2)
    error('TTT requires at least two arguments.');
end