Skip to content
10 changes: 5 additions & 5 deletions include/graphblas/reference/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,13 @@ namespace grb {
typename fwd_iterator
>
RC buildMatrixUnique(
const fwd_iterator & _start,
const fwd_iterator & _end
const fwd_iterator &_start,
const fwd_iterator &_end
) {
#ifdef _DEBUG
std::cout << "buildMatrixUnique called with " << cap << " nonzeroes.\n";
std::cout << "buildMatrixUnique: input is\n";
for( auto it = _start; it != _end; ++it ) {
for( fwd_iterator it = _start; it != _end; ++it ) {
std::cout << "\t" << it.i() << ", " << it.j() << "\n";
}
std::cout << "buildMatrixUnique: end input.\n";
Expand Down Expand Up @@ -894,10 +894,10 @@ namespace grb {

#ifdef _DEBUG
for( size_t i = 0; i <= m; ++i ) {
(void)printf( "row_start[ %ld ] = %ld.\n", i, CRS.col_start[ i ] );
std::cout << "row_start[ " << i << " ] = " << CRS.col_start[ i ] << ".\n";
}
for( size_t i = 0; i <= n; ++i ) {
(void)printf( "col_start[ %ld ] = %ld.\n", i, CCS.col_start[ i ] );
std::cout << "col_start[ " << i << " ] = " << CCS.col_start[ i ] << ".\n";
}
#endif

Expand Down
71 changes: 71 additions & 0 deletions include/graphblas/utils/iscomplex.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

/*
* Copyright 2021 Huawei Technologies Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* @author A. N. Yzelman
* @date 12th of April, 2022
*/

#ifndef _H_GRB_UTILS_ISCOMPLEX
#define _H_GRB_UTILS_ISCOMPLEX

#include <complex>


namespace grb {

namespace utils {

/**
* A template class used for inspecting whether a given class is of type
* std::complex.
*
* @tparam C The type to check.
*
* \internal This is the base implementation which assumes \a C is not of
* type std::complex.
*/
template< typename C >
class is_complex {

public:

/**
* If \a value is <tt>false</tt>, the type will be \a C.
* If \a value is <tt>true</tt>, the type will be C::value_type.
*/
typedef C type;

/** Whether the type \a C is std::complex */
static constexpr const bool value = false;

};

/** \internal The specialisation for std::complex types. */
template< typename T >
class is_complex< std::complex< T > > {
public:
typedef T type;
static constexpr const bool value = true;
};

} // end namespace utils

} // end namespace grb

#endif // end _H_GRB_UTILS_ISCOMPLEX

Loading