diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 714e6034b..5b48b9e55 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -219,30 +219,20 @@ install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/graphblas/interfaces/"
install( TARGETS algorithms EXPORT GraphBLASTargets )
-# generate the spblas header with the library prefix
-configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/transition/spblas.h.in
- ${CMAKE_CURRENT_BINARY_DIR}/transition/spblas.h @ONLY
-)
-
# this target lists the transition path headers
# these are plain C headers and do not have any dependences
-add_library( transition_headers INTERFACE )
+add_library( transition INTERFACE )
target_include_directories(
- transition_headers INTERFACE
+ transition INTERFACE
$
- $
$
)
-install( FILES ${CMAKE_CURRENT_BINARY_DIR}/transition/spblas.h
- DESTINATION "${INCLUDE_INSTALL_DIR}/transition"
-)
-
install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/transition/"
- DESTINATION "${INCLUDE_INSTALL_DIR}/transition"
+ DESTINATION "${GRB_INCLUDE_INSTALL_DIR}/../transition/"
FILES_MATCHING REGEX "${HEADERS_REGEX}"
)
-install( TARGETS transition_headers EXPORT GraphBLASTargets )
+install( TARGETS transition EXPORT GraphBLASTargets )
diff --git a/include/graphblas.hpp b/include/graphblas.hpp
index 7a61f9599..a539a5c0d 100644
--- a/include/graphblas.hpp
+++ b/include/graphblas.hpp
@@ -38,11 +38,6 @@
* -# generalised sparse linear algebra, \ref GraphBLAS;
* -# vertex-centric programming, \ref Pregel.
*
- * Additionally, to ease integration with existing software, ALP defines
- * so-called \ref TRANS libraries, which presently includes (partial)
- * implementations of the \ref SPARSEBLAS and \ref SPBLAS (de-facto) standards,
- * as well as an interface for numerical \ref TRANS_SOLVERS.
- *
* Several other programming interfaces are under design at present.
*
* For authors who contributed to ALP, please see the NOTICE file.
diff --git a/include/graphblas/algorithms/conjugate_gradient.hpp b/include/graphblas/algorithms/conjugate_gradient.hpp
index 27616ec77..b87cfa080 100644
--- a/include/graphblas/algorithms/conjugate_gradient.hpp
+++ b/include/graphblas/algorithms/conjugate_gradient.hpp
@@ -27,7 +27,7 @@
#define _H_GRB_ALGORITHMS_CONJUGATE_GRADIENT
#include
-#include
+#include
#include
#include
@@ -144,8 +144,7 @@ namespace grb {
* performance semantics, with the exception of getters such as #grb::nnz, are
* specific to the backend selected during compilation.
*/
- template<
- Descriptor descr = descriptors::no_operation,
+ template< Descriptor descr = descriptors::no_operation,
typename IOType,
typename ResidualType,
typename NonzeroType,
@@ -155,20 +154,19 @@ namespace grb {
grb::identities::zero, grb::identities::one
>,
class Minus = operators::subtract< IOType >,
- class Divide = operators::divide< IOType >,
- typename RSI, typename NZI, Backend backend
+ class Divide = operators::divide< IOType >
>
grb::RC conjugate_gradient(
- grb::Vector< IOType, backend > &x,
- const grb::Matrix< NonzeroType, backend, RSI, RSI, NZI > &A,
- const grb::Vector< InputType, backend > &b,
+ grb::Vector< IOType > &x,
+ const grb::Matrix< NonzeroType > &A,
+ const grb::Vector< InputType > &b,
const size_t max_iterations,
ResidualType tol,
size_t &iterations,
ResidualType &residual,
- grb::Vector< IOType, backend > &r,
- grb::Vector< IOType, backend > &u,
- grb::Vector< IOType, backend > &temp,
+ grb::Vector< IOType > &r,
+ grb::Vector< IOType > &u,
+ grb::Vector< IOType > &temp,
const Ring &ring = Ring(),
const Minus &minus = Minus(),
const Divide ÷ = Divide()
@@ -326,7 +324,7 @@ namespace grb {
assert( ret == SUCCESS );
if( ret == SUCCESS ) {
- tol *= std::sqrt( grb::utils::is_complex< IOType >::modulus( bnorm ) );
+ tol *= sqrt( grb::utils::is_complex< IOType >::modulus( bnorm ) );
}
size_t iter = 0;
@@ -419,7 +417,7 @@ namespace grb {
// return correct error code
if( ret == SUCCESS ) {
- if( std::sqrt( residual ) >= tol ) {
+ if( sqrt( residual ) >= tol ) {
// did not converge within iterations
return FAILED;
}
diff --git a/include/graphblas/algorithms/triangle_count.hpp b/include/graphblas/algorithms/triangle_count.hpp
new file mode 100644
index 000000000..6cb9f2ca7
--- /dev/null
+++ b/include/graphblas/algorithms/triangle_count.hpp
@@ -0,0 +1,249 @@
+
+/*
+ * Copyright 2023 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.
+ */
+
+/**
+ * @file
+ *
+ * Implements the triangle counting algorithm, using different methods.
+ *
+ * @author Benjamin Lozes
+ * @date: May 10th, 2023
+ */
+
+#ifndef _H_GRB_TRIANGLE_COUNT
+#define _H_GRB_TRIANGLE_COUNT
+
+#include