Commit f1a8e7d5 authored by Ben Huber's avatar Ben Huber

create correct links from jekyll pages to doxygen documentation

parent 15bca0b0
......@@ -224,7 +224,7 @@ fullTest: $(TUTORIALS) $(TEST_NAME)
.FORCE:
doc: .FORCE
doc: .FORCE doc/parseDoxytags doc/findDoxytag
make -C doc doc
......@@ -239,7 +239,6 @@ clean:
benchmark: $(MINIMAL_DEPS) $(LOCAL_HEADERS) benchmark.cxx $(LIB_NAME_STATIC)
$(CXX) $(FLAGS) benchmark.cxx $(LIB_NAME_STATIC) $(SUITESPARSE) $(LAPACK_LIBRARIES) $(BLAS_LIBRARIES) $(CALLSTACK_LIBS) -lboost_filesystem -lboost_system -o Benchmark
# Build rule for normal misc objects
build/.miscObjects/%.o: %.cpp $(MINIMAL_DEPS)
mkdir -p $(dir $@)
......
......@@ -8,15 +8,32 @@ help:
\t\tserve \t\t -- Build the html documentation for the xerus library and offer it via 'jekyll serve'.\n \
\t\tclean \t\t -- Remove all documentation files.\n"
doc:
.FORCE:
doc: .FORCE parseDoxytags findDoxytag
-mkdir html
doxygen doxygen/Doxyfile
./parseDoxytags
jekyll build --source jekyll/ --destination html/
clean:
-rm -r html
serve:
serve: .FORCE parseDoxytags findDoxytag
-mkdir html
doxygen doxygen/Doxyfile
./parseDoxytags
jekyll serve --source jekyll/ --destination html/
include ../config.mk
include ../makeIncludes/general.mk
include ../makeIncludes/warnings.mk
include ../makeIncludes/optimization.mk
FLAGS = $(strip $(WARNINGS) $(OPTIMIZE) $(OTHER))
parseDoxytags: ../src/docHelper/parseDoxytags.cpp
$(CXX) $(FLAGS) ../src/docHelper/parseDoxytags.cpp -o parseDoxytags
findDoxytag: ../src/docHelper/findDoxytag.cpp
$(CXX) $(FLAGS) ../src/docHelper/findDoxytag.cpp -o findDoxytag
......@@ -23,6 +23,7 @@ class TabsConverter < Converter
.gsub('__breakFix1</a></p>', "")
.gsub('<p>__breakFix2', "</a>")
.gsub('__version', %x( git describe --tags --always --abbrev=0 ) )
.gsub(/__doxyref\(([^\)]+)\)/){ |m| %x( ./findDoxytag #{$1} ) }
end
end
end
......
......@@ -216,7 +216,7 @@ xerus.Tensor.sparsityFactor = 4
~~~
__tabsEnd
in particular, setting the [sparsityFactor](\ref xerus::Tensor::sparsityFactor) to 0 will disable this feature.
in particular, setting the [sparsityFactor](__doxyref(xerus::Tensor::sparsityFactor)) to 0 will disable this feature.
__tabsStart
~~~ cpp
......@@ -235,12 +235,12 @@ in dense representation. You should thus manually convert overly full sparse Ten
To do this there are a number of ways to interact with the representation of `xerus::Tensor` objects. Above we already saw, that
the constructors can be used to explicitely construct sparse (default behaviour) or dense tensors. For already existing objects
you can use the member functions [.is_sparse()](\ref xerus::Tensor::is_sparse()) and [.is_dense()](\ref xerus::Tensor::is_dense()) to query their representation. To change representations call the
member functions [.use_dense_representation()](\ref xerus::Tensor::use_dense_representation()) or [.use_sparse_representation()](\ref xerus::Tensor::use_sparse_representation()) to change it inplace or [.dense_copy()](\ref xerus::Tensor::dense_copy()) or
[.sparse_copy()](\ref xerus::Tensor::sparse_copy()) to obtain new tensor objects with the desired representation.
you can use the member functions [.is_sparse()](__doxyref(xerus::Tensor::is_sparse)) and [.is_dense()](__doxyref(xerus::Tensor::is_dense)) to query their representation. To change representations call the
member functions [.use_dense_representation()](__doxyref(xerus::Tensor::use_dense_representation)) or [.use_sparse_representation()](__doxyref(xerus::Tensor::use_sparse_representation)) to change it inplace or [.dense_copy()](__doxyref(xerus::Tensor::dense_copy)) or
[.sparse_copy()](__doxyref(xerus::Tensor::sparse_copy)) to obtain new tensor objects with the desired representation.
To make more informed decisions about whether a conversion might be useful the tensor objects can be queried for the number of
defined entries with [.sparsity()](\ref xerus::Tensor::sparsity()) or for the number of non-zero entries with [.count_non_zero_entries()](\ref xerus::Tensor::count_non_zero_entries()).
defined entries with [.sparsity()](__doxyref(xerus::Tensor::sparsity)) or for the number of non-zero entries with [.count_non_zero_entries()](__doxyref(xerus::Tensor::count_non_zero_entries)).
__tabsStart
~~~ cpp
......@@ -281,8 +281,8 @@ __tabsEnd
## Output and Storing
Probably the most common queries to the Tensor class are its degree with [.degree()](\ref xerus::Tensor::degree())
as well as its precise dimensions by accessing [.dimensions](\ref xerus::Tensor::dimensions).
Probably the most common queries to the Tensor class are its degree with [.degree()](__doxyref(xerus::Tensor::degree))
as well as its precise dimensions by accessing [.dimensions](__doxyref(xerus::Tensor::dimensions)).
__tabsStart
~~~ cpp
......@@ -307,8 +307,8 @@ print("degree:", A.degree(), "dim:", A.dimensions())
__tabsEnd
Another useful and commonly used query is for the norm of a tensor. At the moment `xerus` provides member functions for the
two most commonly used norms: [.frob_norm()](\ref xerus::Tensor::frob_norm()) (or equivalently
`frob_norm(const Tensor&)`) to obtain the Frobenius norm and [.one_norm()](\ref xerus::Tensor::one_norm()) (or equivalently
two most commonly used norms: [.frob_norm()](__doxyref(xerus::Tensor::frob_norm)) (or equivalently
`frob_norm(const Tensor&)`) to obtain the Frobenius norm and [.one_norm()](__doxyref(xerus::Tensor::one_norm)) (or equivalently
`one_norm(const Tensor&)`) to obtain the p=1 norm of the tensor.
__tabsStart
......@@ -330,12 +330,12 @@ print(xerus.one_norm(A), xerus.frob_norm(A))
__tabsEnd
To obtain a human readable string representation of the tensor, [.to_string()](\ref xerus::Tensor::to_string()) can be used.
To obtain a human readable string representation of the tensor, [.to_string()](__doxyref(xerus::Tensor::to_string)) can be used.
Note that it is meant purely for debugging purposes, in particular of smaller objects, and it is not adequately possible to
reconstruct the original tensor from this output.
Storing Tensors to files such that they can be reconstructed exactly from those is instead possible with [save_to_file()](\ref xerus::misc::save_to_file())
and respectively [load_from_file()](\ref xerus::misc::load_from_file()).
Storing Tensors to files such that they can be reconstructed exactly from those is instead possible with [save_to_file()](__doxyref(xerus::misc::save_to_file))
and respectively [load_from_file()](__doxyref(xerus::misc::load_from_file)).
__tabsStart
~~~ cpp
......@@ -375,8 +375,8 @@ __tabsEnd
## Operators and Modifications
We have already seen the most basic method of modifying a tensor via the [operator[]](\ref xerus::Tensor::operator[]()). With it
and the index notation presented in the [indices and equations](\ref md_indices) tutorial, most desired manipulations can be
We have already seen the most basic method of modifying a tensor via the [operator[]](__doxyref(xerus::Tensor::operator[])). With it
and the index notation presented in the [indices and equations](indices) tutorial, most desired manipulations can be
represented. Some of them would still be cumbersome though, so `xerus` includes several helper functions to make your life easier.
The purpose of this section is to present the most important ones.
......@@ -447,10 +447,10 @@ __tabsEnd
This operation is obviously only possible when the total number of entries remains unchanged.
If you want to change the dimensions of a tensor such that the total size changes, you have to specify how to do this. `xerus`
provides three functions to help you in such a case: [.resize_mode()](\ref xerus::Tensor::resize_mode()) changes the dimension
of a single mode by adding zero slates or removing existing slates at a given position; [.fix_mode()](\ref xerus::Tensor::fix_mode())
provides three functions to help you in such a case: [.resize_mode()](__doxyref(xerus::Tensor::resize_mode)) changes the dimension
of a single mode by adding zero slates or removing existing slates at a given position; [.fix_mode()](__doxyref(xerus::Tensor::fix_mode))
reduces the tensor to an object of degree d-1 that corresponds to the slate, selected in the call to the function; finally
[.remove_slate()](\ref xerus::Tensor::remove_slate()) is a simplified version of `.resize_mode()` that removes a single slate
[.remove_slate()](__doxyref(xerus::Tensor::remove_slate)) is a simplified version of `.resize_mode()` that removes a single slate
from the tensor, reducing the dimension of the specified mode by one.
__tabsStart
......@@ -484,7 +484,7 @@ print(A)
__tabsEnd
At the moment the Hadamard product is not available in a indexed notation (due to a lack of overloadable operators). Its
behaviour can instead be achieved with [entrywise_product()](\ref xerus::entrywise_product()).
behaviour can instead be achieved with [entrywise_product()](__doxyref(xerus::misc::entrywise_product)).
__tabsStart
~~~ cpp
......@@ -546,6 +546,6 @@ The average user of `xerus` does not need to worry about this internal mechanism
to the underlying data structues e.g. to call `blas` or `lapack` routines not supported by `xerus` or to convert objects from
other libraries to and from `xerus::Tensor` objects. If you do, make sure to check out the documentation
for the following functions (c++ only):
* [.has_factor()](\ref xerus::Tensor::has_factor()) and [.apply_factor()](\ref xerus::Tensor::apply_factor())
* [.get_dense_data()](\ref xerus::Tensor::get_dense_data()); [.get_unsanitized_dense_data()](\ref xerus::Tensor::get_unsanitized_dense_data()); [.get_internal_dense_data()](\ref xerus::Tensor::get_internal_dense_data())
* [.get_sparse_data()](\ref xerus::Tensor::get_sparse_data()); [.get_unsanitized_sparse_data()](\ref xerus::Tensor::get_unsanitized_sparse_data()); [.get_internal_sparse_data()](\ref xerus::Tensor::get_internal_sparse_data())
* [.has_factor()](__doxyref(xerus::Tensor::has_factor)) and [.apply_factor()](__doxyref(xerus::Tensor::apply_factor))
* [.get_dense_data()](__doxyref(xerus::Tensor::get_dense_data)); [.get_unsanitized_dense_data()](__doxyref(xerus::Tensor::get_unsanitized_dense_data)); [.get_internal_dense_data()](__doxyref(xerus::Tensor::get_internal_dense_data))
* [.get_sparse_data()](__doxyref(xerus::Tensor::get_sparse_data)); [.get_unsanitized_sparse_data()](__doxyref(xerus::Tensor::get_unsanitized_sparse_data)); [.get_internal_sparse_data()](__doxyref(xerus::Tensor::get_internal_sparse_data))
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
int main(int argc, char *argv[]) {
if (argc < 2) {
std::cerr << "### no argument given to find the tag for..." << std::endl;
return 1;
}
std::string memberName(argv[1]);
std::ifstream inFile("xerus.tags");
std::string line;
while (std::getline(inFile, line)) {
std::vector<std::string> parts;
boost::split(parts, line, boost::is_any_of("\t"));
if (parts[0] == memberName) {
std::cout << parts[1] << std::endl;
return 0;
}
}
std::cerr << "### '" << memberName << "' not found in xerus.tags" << std::endl;
return 2;
}
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
using boost::property_tree::ptree;
int main() {
ptree pt;
read_xml("xerus.tagfile", pt);
std::map<std::string, std::string> tags;
for (const auto &compound : pt.get_child("tagfile")) {
std::string currNamespace = "";
if (compound.first != "compound") {
std::cout << "*** skipping " << compound.first << " tag" << std::endl;
continue;
}
std::string kind = compound.second.get<std::string>("<xmlattr>.kind", "N/A");
if (kind == "page") {
continue;
}
if (kind == "class" || kind == "struct" || kind == "namespace") {
currNamespace = compound.second.get<std::string>("name");
}
for (const auto &subc : compound.second) {
// we are looking for namespaces (in order! -.-) and members
if (subc.first == "namespace") {
currNamespace = subc.second.get<std::string>("");
} else if (subc.first == "member") {
std::string name = subc.second.get<std::string>("name");
std::string subkind = subc.second.get<std::string>("<xmlattr>.kind", "N/A");
std::string anchorfile = subc.second.get<std::string>("anchorfile");
std::string anchor = subc.second.get<std::string>("anchor");
std::string args = subc.second.get<std::string>("arglist");
if (currNamespace!= "" && subkind != "define") {
name = currNamespace+"::"+name;
}
boost::replace_all(name, " ", "");
tags[name] = anchorfile + '#' + anchor;
} else {
// std::cout << "* skipping " << subc.first << std::endl;
}
}
}
std::ofstream outFile("xerus.tags");
for (const auto &t : tags) {
outFile << t.first << "\t/doxygen/" << t.second << '\n';
}
std::cout << "### found " << tags.size() << " unique tags in xerus.tagfile created by doxygen." << std::endl;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment