generated from jnooree/c-like-templ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from seoklab/jnooree/issue-361
feat(algo/crdgen): implement basic DG coordinate generation routine
- Loading branch information
Showing
13 changed files
with
920 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// Project NuriKit - Copyright 2024 SNU Compbio Lab. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#ifndef NURI_ALGO_CRDGEN_H_ | ||
#define NURI_ALGO_CRDGEN_H_ | ||
|
||
/// @cond | ||
#include <utility> | ||
/// @endcond | ||
|
||
#include "nuri/eigen_config.h" | ||
#include "nuri/core/molecule.h" | ||
|
||
namespace nuri { | ||
/** | ||
* @brief Generate 3D coordinates for the molecule. | ||
* | ||
* @param mol The molecule to generate coordinates. | ||
* @param conf A matrix to store the generated coordinates. | ||
* @param max_trial The maximum number of trials to generate trial distances. | ||
* @return Whether the coordinates is successfully generated. | ||
*/ | ||
extern bool generate_coords(const Molecule &mol, Matrix3Xd &conf, | ||
int max_trial = 10); | ||
|
||
/** | ||
* @brief Generate 3D coordinates for the molecule. | ||
* | ||
* @param mol The molecule to generate coordinates. | ||
* @return Whether the coordinates is successfully generated. | ||
* | ||
* @note The generated coordinates is stored as the last conformer of the | ||
* molecule, if and only if the coordinates is successfully generated. The | ||
* molecule is not modified otherwise. | ||
*/ | ||
inline bool generate_coords(Molecule &mol, int max_trial = 10) { | ||
Matrix3Xd conf; | ||
bool success = generate_coords(mol, conf, max_trial); | ||
if (success) | ||
mol.confs().push_back(std::move(conf)); | ||
return success; | ||
} | ||
} // namespace nuri | ||
|
||
#endif /* NURI_ALGO_CRDGEN_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.