Skip to content

Commit

Permalink
Add the IndexVec docs group
Browse files Browse the repository at this point in the history
  • Loading branch information
mrossinek committed Dec 20, 2024
1 parent 933f3d7 commit c60d9d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/c_ext/src/sparse_observable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use num_complex::Complex64;
use qiskit_accelerate::sparse_observable::{BitTerm, SparseObservable, SparseTerm};

/// @ingroup IndexVec
/// A vector of indices as ``uint_32t``.
#[derive(Debug, Clone)]
pub struct IndexVec {
Expand Down Expand Up @@ -76,6 +77,7 @@ pub extern "C" fn pauli_deallocate(pauli: &mut PauliTerm) {
}
}

/// @ingroup IndexVec
/// Create a new index vector of ``uint32_t``\ s.
///
/// @return A pointer to an empty index vector.
Expand All @@ -91,6 +93,7 @@ pub extern "C" fn indices_new() -> *mut IndexVec {
Box::into_raw(Box::new(indices))
}

/// @ingroup IndexVec
/// Create a new index vector of ``uint32_t``\ s, with a given capacity.
///
/// @param capacity The capacity to allocate for the vector.
Expand All @@ -111,6 +114,7 @@ pub extern "C" fn indices_with_capacity(capacity: u64) -> *mut IndexVec {
Box::into_raw(Box::new(indices))
}

/// @ingroup IndexVec
/// Free the index vector.
///
/// @param indices A pointer to the index vector to be freed.
Expand All @@ -129,6 +133,7 @@ pub extern "C" fn indices_deallocate(indices: &mut IndexVec) {
}
}

/// @ingroup IndexVec
/// Push a new index onto the index vector.
///
/// @param indices A pointer to the index vector.
Expand Down
4 changes: 4 additions & 0 deletions docs/cdoc/sparse_observable.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
/**
* @defgroup BitTermVec BitTermVec
*/

/**
* @defgroup IndexVec IndexVec
*/
2 changes: 2 additions & 0 deletions docs/cdoc/sparse_observable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Sparse Observable
.. doxygengroup:: PauliTermVec

.. doxygengroup:: BitTermVec

.. doxygengroup:: IndexVec

0 comments on commit c60d9d4

Please sign in to comment.